package com.michaelbulava.TFS.ui.controls.workspaces;

import com.microsoft.tfs.core.TFSTeamProjectCollection;
import com.microsoft.tfs.core.clients.versioncontrol.soapextensions.Workspace;
import com.microsoft.tfs.util.Check;

/**
 * Created by mbulava on 7/15/2015.
 */
public class WorkspaceData
{
    private final WorkspaceDetails workspaceDetails;
    private WorkingFolderDataCollection workingFolderDataCollection;

    public WorkspaceData(TFSTeamProjectCollection connection, String defaultWorkspaceName)
    {
        Check.notNull(connection, "connection");
        Check.notNullOrEmpty(defaultWorkspaceName, "defaultWorkspaceName");

        this.workspaceDetails = new WorkspaceDetails(connection, defaultWorkspaceName);
        this.workingFolderDataCollection = new WorkingFolderDataCollection();
    }

    public WorkspaceData(Workspace workspace)
    {
        Check.notNull(workspace, "workspace");

        this.workspaceDetails = new WorkspaceDetails(workspace);
        this.workingFolderDataCollection = new WorkingFolderDataCollection(workspace);
    }

    public WorkspaceDetails getWorkspaceDetails()
    {
        return this.workspaceDetails;
    }

    public WorkingFolderDataCollection getWorkingFolderDataCollection()
    {
        return this.workingFolderDataCollection;
    }

    public void setWorkingFolderDataCollection(WorkingFolderDataCollection value){
        this.workingFolderDataCollection = value;
    }


}
